//
//  DestinationFirCollectionViewCell.m
//  EDPS
//
//  Created by Neil on 15/11/25.
//  Copyright © 2015年 张维扬. All rights reserved.
//

#import "DestinationFirCollectionViewCell.h"

@implementation DestinationFirCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.view  = [[UIView alloc] initWithFrame:self.contentView.bounds];
        [self.contentView addSubview:self.view];
        
        self.cover_s = [[UIImageView alloc] initWithFrame:self.view.bounds];
        [self.view addSubview:self.cover_s];
        
        self.cover_s.layer.cornerRadius = 20;
        self.cover_s.layer.masksToBounds = YES;

        self.name = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.height - 30, self.contentView.frame.size.width, 30)];
        [self.cover_s addSubview:self.name];
        self.name.textAlignment = NSTextAlignmentCenter;
        self.name.textColor = [UIColor whiteColor];

        self.layer.allowsEdgeAntialiasing = YES;
    }
    return self;
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    [super applyLayoutAttributes:layoutAttributes];

    self.cover_s.frame = self.contentView.frame;
    self.name.frame = CGRectMake(0, self.contentView.frame.size.height - 30, self.contentView.frame.size.width, 30);
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
